{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 练习\n",
    "- 小明身高1.75，体重80.5kg。请根据BMI公式（体重除以身高的平方）帮小明计算他的BMI指数，并根据BMI指数：\n",
    "    - 低于18.5：过轻\n",
    "    - 18.5-25：正常\n",
    "    - 25-28：过重\n",
    "    - 28-32：肥胖\n",
    "    - 高于32：严重肥胖\n",
    "- 用if-elif判断并打印结果："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "正常\n"
     ]
    }
   ],
   "source": [
    "height = 1.75\n",
    "weight = 80.5\n",
    "BMI = weight/(height*2)\n",
    "if BMI < 18.5:\n",
    "    print('过轻')\n",
    "elif 18.5 <= BMI <= 25:\n",
    "    print('正常')\n",
    "elif 25 <= BMI <=28:\n",
    "    print('过重')\n",
    "elif 28 <= BMI <=32:\n",
    "    print('肥胖')\n",
    "elif BMI > 32:\n",
    "    print('严重肥胖')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
